package com.spsoft.vatoutinv.service.vmsfullyfmmessage;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.spsoft.core.model.Result;
import com.spsoft.core.model.bo.TokenUser;
import com.spsoft.vatoutinv.entity.vmsfullyfmmessage.VmsFullYfmDetails;
import com.spsoft.vatoutinv.entity.vmsfullyfmmessage.VmsFullYfmMessage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.spsoft.vatoutinv.model.dto.vmsfullyfmmessage.VmsFullYfmMessageDto;
import com.spsoft.vatoutinv.model.vo.vmsfullyfmmessage.VmsFullYfmMessageVo;

import java.util.List;

/**
 * <p>
 * 预赋码信息管理表;预赋码信息管理表 服务类
 * </p>
 *
 * @author chenxudong
 * @since 2023-11-28
 */
public interface VmsFullYfmMessageService extends IService<VmsFullYfmMessage> {

    /**
     * 查询本地预赋码信息
     */
    Result<IPage<VmsFullYfmMessageVo>> queryVmsFullYfmMessage(VmsFullYfmMessageDto vmsFullYfmMessageDto);

    /**
     * 调用乐企批量获取预赋码信息
     */
    Result<Object> getVmsFullYfmMessageByLq(VmsFullYfmMessageDto vmsFullYfmMessageDto, TokenUser userInfo);

    /**
     * 根据当前登录机构获取可用预赋码信息
     */
    List<VmsFullYfmMessage> getYfmByDeptCode(String deptCode);

    /**
     * 根据预赋码明细更新号段剩余总数、当前待使用发票号码
     */
    Result<Object> updateYfmByDetail(VmsFullYfmMessage vmsFullYfmMessage, TokenUser userInfo);

    /**
     * 分配预付码
     */
    List<VmsFullYfmDetails> yfmDistribution(List<VmsFullYfmMessage> yfmMessageList, Long size, TokenUser userInfo);

    /**
     * 回滚预赋码
     */
    Result<Object> rollBackYfm(String fphm, TokenUser userInfo);

    /**
     * 作废本年度未使用的预赋码
     */
    Result<Object> invalidYearYfm(String deptCode, TokenUser userInfo);
}
